using Blog.Service;
using Blog.Service.Api;
using Blog.Service.Api.Output;
using Microsoft.AspNetCore.Mvc;

namespace Blog.API.Controllers;



/// <summary>
/// 接口管理
///</summary>
[ApiController]
[Route("api/admin/[controller]/[action]")]
public class ApiController : CrudController<ApiModel>
{
    private readonly IApiService _apiService;

    public ApiController(IApiService apiService) : base(apiService)
    {
        _apiService = apiService;
    }

    /// <summary>
    /// 查询全部接口
    /// </summary>
    /// <param name="key"></param>
    /// <returns></returns>
    [HttpGet]
    public async Task<List<ApiListOutput>> GetList(string? key)
    {
        return await _apiService.List(key);
    }
}
